@echo off
setlocal
set "masm=%1"
set "filename=%2"
set "dir=%3"
set "output=%4"
set "gcc=%5"

chcp 65001 >NUL

%masm%\bin64\ml64.exe /c %filename%.asm || goto terminate

%gcc% %filename%.obj -o %filename%.exe -L bin64 || goto terminate

if not exist %output% mkdir %output%
if exist %filename%.obj move %filename%.obj %output%>NUL
if exist %filename%.exe move %filename%.exe %output%>NUL
if exist %filename%.lst move %filename%.lst %output%>NUL
if exist %filename%.ilk move %filename%.ilk %output%>NUL
if exist %filename%.pdb move %filename%.pdb %output%>NUL

cls
echo successfully compiled %filename%.asm
echo ---------------------------------------
%output%\%filename%.exe
echo.

:terminate
endlocal
@echo on